package weaver.generalledger.action;

import weaver.conn.RecordSet;
import weaver.general.BaseBean;
import weaver.interfaces.workflow.action.Action;
import weaver.soa.workflow.request.RequestInfo;
import weaver.workflow.request.RequestManager;
import weaver.workflow.workflow.WorkflowComInfo;

public class ZzTestAction  extends BaseBean implements Action {
    @Override
    public String execute(RequestInfo requestInfo) {
        writeLog("进入方法 ZzTestAction："+requestInfo);
        RequestManager requestManager = requestInfo.getRequestManager();
        String requestid = requestInfo.getRequestid();
        String workflowid = requestInfo.getWorkflowid();
        String nodetype = requestManager.getNodetype();
        String formId = (new WorkflowComInfo()).getFormId(workflowid);
        String tableName = getNameById(formId);
        String lastoperator = requestInfo.getLastoperator();
        RecordSet rs=new RecordSet();
        String sql="select * from "+tableName+" where requestid=?";
        rs.executeQuery(sql,requestid);
        while (rs.next()){
            writeLog("bdh--->"+rs.getString("bdh"));
        }


        return null;
    }
    public static String getNameById(String var0) {
        RecordSet var1 = new RecordSet();
        String var2 = "";
        String var3 = "select tablename from workflow_bill where id=?";
        var1.executeQuery(var3, new Object[]{var0});
        if (var1.next()) {
            var2 = var1.getString("tablename");
        }

        return var2;
    }
}
